from django.conf.urls import url
from book.views import index, detail

urlpatterns = [
    url(r'^index/$', index, name='index'),
    # url(r'^(?P<category_id>\d+)/(?P<book_id>\d+)/$', detail, name='detail'),  # 这样起别名，会报参数个数的错
    #  通过url传递请求
    url(r'^(?P<category_id>\d+)/(?P<book_id>\d+)/$', detail),
]